<html>
<head>
<title>asharp</title>
   <link rel="stylesheet" type="text/css" href="../../avisynth.css">
<!--
Automatically generated, don't change:
$Id: asharp.htm,v 1.2 2004/08/13 21:57:25 wilbertd Exp $ 
-->
</head>
<body>
<h1>Asharp</h1>
<h2>Abstract</h2>
<b>author:</b> MarcFD
<br><b>version:</b> 0.95<br>
<b>download:</b> <a href="http://ziquash.chez.tiscali.fr/">http://ziquash.chez.tiscali.fr/</a><br>
<b>category:</b> Sharpen/Soften Plugins<br>
<b>requirements:</b> YV12 Colorspace
<hr>
<h2>Description</h2>
Basically, this filter is a very common unsharp mask, simply because unsharp<br>
mask is the most pleasant sharpenning technique for my eyes ^^<br>
but i've added 3 simple ideas i had about sharpening :<br>
- adaptive thresholding to avoid noise enhancement<br>
- block adaptive sharpenning to avoid DCT block edges enhancement<br>
- block based adaptive thresholding to avoid DCT block edges enhancement<br>
<br>
it's optimised for quality, not speed. but... i love speed ^^<br>
so i've added very optimised MMX/ISSE code.<br>
<br>
it's working in YV12 colorspace, and on luma only<br>
(chroma sharpenning seems to only introduce artifacts)<br>
<h3>Usage of asharp</h3>
	First, add the following line in your .avs script :
<pre>LoadPlugin(&quot;asharp.dll&quot;) # because Avisynth 2.5 doesn't support Autoloading yet</pre>
<p>To do simple unsharp masking with a strength of 2x :</p>
<pre>Asharp(2,0)</pre>
<p>To try some adaptive sharpenning :</p>
<pre>Asharp(2, 4)</pre>
<p>Suggestion for divx anime decoding :</p>
<pre>Asharp(2. 5, 4.5, 0.25, hqbf=true)</pre>
<h3>Syntax</h3>
	<code>
    asharp
	</code> (<var>float "T", float "D", float "B", bool &quot;hqbf&quot;</var>)
<p><var>T</var> : unsharp masking threshold. 0 will do nothing. (value clamped to [nothing=0..32])</p>
<p><var>T</var> = 1 is like 32 with ffdsow/Vdub unsharp mask filter, it'll enhance contrast 1x.
Default is <var>T</var> = 2.</p>
<p><var>D</var> : adaptive sharpenning strength. (value clamped to [disabled=0..16])</p>
<p>set to 0 to disable.<br>
If <var>D</var> &gt; 0, adaptive thresholding is enabled.<br>
The threshold is adapted for each pixel (bigger for edges).<br>
If adaptive sharpenning is enabled, <var> T</var> acts like a maximum.<br>
Default is <var>D</var> = 4.</p>
<p><var>B </var> : block adaptive sharpenning. (value clamped to [disabled=0..4])</p>
<p>Set to a negative value to disable.<br>
If <var>B</var> &gt;= 0, block adaptive sharpenning is enabled.<br>
It acts very simply, by lowering the threshold around DCT-blocks edges.<br>
If you use it, avoid any non mod8 cropping between the decoder and asharp.<br>
	(it works only wit adaptive sharpenning, when <var>D</var> &gt; 0)<br>
Default is <var>B</var> = -1 (disabled)</p>
<p><u><var>hqbf</var></u> : high quality block filtering. (aka block based adaptive thresholding.)</p>
<p>It was painfull to implement in SIMD, but i love it.<br>
Try with and without on a blocky video, and you'll understand why ^^<br>
It works only with adaptive thresholding.<br>
Default is false (disabled)<br>
</p>
<p><kbd>$Date: 2004/08/13 21:57:25 $</kbd></p>
</body>
</html>